Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(api) fix output of records in /plugins/schema #4162

Merged
merged 1 commit into from
Jan 7, 2019

Conversation

hishamhm
Copy link
Contributor

@hishamhm hishamhm commented Jan 7, 2019

  • Ensure that plugin schemas return sub-fields of nested records in the same
    format as the toplevel fields entry (i.e., as an array of single-fields
    objects, so that the field order can be retrieved).
  • Ensure fields in /plugins/schema always returns a JSON array,
    even when it is empty (as in the prometheus plugin).

This produces an incompatible output from that of 1.0.0, but I'm opening this against master because the one in 1.0.0 is arguably broken, so this produces the intended result.

Fixes #4137.

@hishamhm hishamhm force-pushed the fix/plugin-schema-fields branch from 8b7ab79 to 47da971 Compare January 7, 2019 18:06
@hishamhm hishamhm changed the title fix(api) fix output of /plugins/schema fix(api) fix output of records in /plugins/schema Jan 7, 2019
@hishamhm hishamhm requested a review from hbagdi January 7, 2019 18:07
kong/api/routes/plugins.lua Outdated Show resolved Hide resolved
kong/api/routes/plugins.lua Show resolved Hide resolved
kong/api/routes/plugins.lua Outdated Show resolved Hide resolved
@hishamhm hishamhm force-pushed the fix/plugin-schema-fields branch from 47da971 to 0e49cb2 Compare January 7, 2019 19:02
@hishamhm
Copy link
Contributor Author

hishamhm commented Jan 7, 2019

@thibaultcha Review addressed! Thanks for the tip about array_mt!

* Ensure that plugin schemas return sub-fields of nested records in the same
  format as the toplevel `fields` entry (i.e., as an array of single-fields
  objects, so that the field order can be retrieved).
* Ensure `fields` in `/plugins/schema` always returns a JSON array,
  even when it is empty (as in the prometheus plugin).

This produces an incompatible output from that of 1.0.0, but the one in
1.0.0 is arguably broken, so this produces the intended result.

Fixes #4137.
@hishamhm hishamhm force-pushed the fix/plugin-schema-fields branch from 0e49cb2 to 8fa9a1e Compare January 7, 2019 20:13
@thibaultcha thibaultcha merged commit 50061b0 into master Jan 7, 2019
@thibaultcha thibaultcha deleted the fix/plugin-schema-fields branch January 7, 2019 21:22
@hishamhm hishamhm added this to the 1.0.1 milestone Jan 10, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants